<?php
class Display_index extends Controller{
	function Display_index(){
		parent::Controller();
	}
	function index(){
		$data['allsort']=$this->commonmodel->get('gaoji_productsort');
		//$data['toutiao']=$this->commonmodel->get_where('gaoji_news','sortid',1);
		//$data['zhuanjia']=$this->commonmodel->get_where('gaoji_news','sortid',2);
		//$data['chanpin']=$this->commonmodel->get_where('gaoji_news','sortid',3);
		//$data['gonggao']=$this->commonmodel->get_where('gaoji_news','sortid',4);
		$this->load->model('list_newsmodel');
		$data['toutiao']=$this->list_newsmodel->getnewsindex(6,'sortid',1,'gaoji_news');
		$data['zhuanjia']=$this->list_newsmodel->getnewsindex(6,'sortid',2,'gaoji_news');
		$data['chanpin']=$this->list_newsmodel->getnewsindex(6,'sortid',3,'gaoji_news');
		$data['gonggao']=$this->list_newsmodel->getnewsindex(6,'sortid',4,'gaoji_news');
		$data['phone']=$this->commonmodel->get_where('gaoji_productsort','pid',1);
		$data['dc']=$this->commonmodel->get_where('gaoji_productsort','pid',4);
		$data['notebook']=$this->commonmodel->get_where('gaoji_productsort','pid',19);
		$this->load->model('list_productmodel');
		$data['bestseller']=$this->list_productmodel->getbestseller();
		$data['new']=$this->list_productmodel->getnew();
		$data['cuxiao']=$this->list_productmodel->getcuxiao();
		if($this->session->userdata('username')==''){
			$this->load->view('html/isnotuser');
		}
		else{
			$this->load->view('html/isuser');
		}
		$this->load->view('html/index',$data);
	}
	function newscontent(){
		if($this->session->userdata('username')==''){
			$this->load->view('html/isnotuser');
		}
		else{
			$this->load->view('html/isuser');
		}
		$data['query']=$this->commonmodel->get_where('gaoji_news','newsid',$this->uri->segment(3));
		$this->load->view('html/newscontent',$data);
	}
	function news(){
		if($this->session->userdata('username')==''){
			$this->load->view('html/isnotuser');
		}
		else{
			$this->load->view('html/isuser');
		}
		$data['toutiao']=$this->commonmodel->get_where('gaoji_news','sortid',1);
		$data['zhuanjia']=$this->commonmodel->get_where('gaoji_news','sortid',2);
		$data['chanpin']=$this->commonmodel->get_where('gaoji_news','sortid',3);
		$data['gonggao']=$this->commonmodel->get_where('gaoji_news','sortid',4);
		$data['phone']=$this->commonmodel->get_where('gaoji_productsort','pid',1);
		$data['dc']=$this->commonmodel->get_where('gaoji_productsort','pid',4);
		$data['notebook']=$this->commonmodel->get_where('gaoji_productsort','pid',19);
		$this->load->view('html/news',$data);
	}
	function service(){
		if($this->session->userdata('username')==''){
			$this->load->view('html/isnotuser');
		}
		else{
			$this->load->view('html/isuser');
		}
		$this->load->view('html/help');
	}
}
?>